Skip to content

fix(lifecycle): share session end with local core supervision - #6119

Closed
4o3F wants to merge 1 commit into
fix/windows-session-endfrom
fix/session-core-lifecycle
Closed

4o3F wants to merge 1 commit into
fix/windows-session-endfrom
fix/session-core-lifecycle

Conversation

@4o3F

@4o3F 4o3F commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Passes the session-end intent from #6117 directly into the local core manager. While a session end is pending, the local core is not restarted automatically, and on Windows a stop kills the existing process tree without launching the --nyanpasu-process-shutdown Ctrl+C helper. Revoking the intent (a cancelled shutdown) restores normal supervision and graceful stops.

Stacks on #6117. Depends on libnyanpasu/nyanpasu-runtime#470 (stacked on #469) and libnyanpasu/nyanpasu-utils#218. Refs #6054.

Changes

  • Pin backend/nyanpasu-runtime to 8250238 (R1, which pins utils a3ec581).
  • SessionEndSource/SessionEnding keep their public bool API but are backed by one utils ProcessActivitySource, so the Windows hook's write and the supervisor's read are the same input, with no forwarding task. The reader still reports that its source was dropped.
  • local_host::build takes the session reader explicitly and passes its process activity to the core manager. setup.rs provides it from the composition root.
  • fake-core: the existing start-barrier error now carries the PID and is published on exit, which the regression test uses as a deterministic start record.

Verification

  • revoking_session_restores_normal_supervision drives the real fake-core through CoreControl. While pending, the first attempt stays the recorded process. After revocation, exactly two retries run. It failed with the activity wiring removed, and it passed 5 consecutive runs.
  • Passing: clash-nyanpasu tests (189), clippy, rustfmt, lint:architecture-ledger, lint:backend-boundaries and the scripts tests.
  • Known environment-only failures: nyanpasu-core's hwid test and nyanpasu-platform's proxy-port test.
  • The Windows tree kill and the zero-helper behavior still need verification on Windows.

Merge order

Merge after #218, #469 and #470. If any of them is squash-merged, re-pin the submodule to the merged commits first.

@semanticdiff-com

semanticdiff-com Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  backend/tauri/src/setup.rs  90% smaller
  backend/fake-core/src/main.rs  61% smaller
  backend/nyanpasu-core/src/actor_v2/local_host.rs  23% smaller
  backend/nyanpasu-core/src/client/session_end.rs  18% smaller
  backend/nyanpasu-runtime  0% smaller

@4o3F
4o3F added this pull request to stack #6120 November 1, 2026 09:06
Pass the revocable session input directly to the local core manager so
pending session end pauses automatic recovery and avoids spawning the
Windows shutdown helper. Restore normal behavior after revocation.

Preserve the session reader's source-closure contract.

Refs #6054
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant